package cn.drenal.capcap.entity;

import cn.drenal.capcap.entity.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tangzc.autotable.annotation.ColumnComment;
import com.tangzc.autotable.annotation.ColumnDefault;
import com.tangzc.autotable.annotation.ColumnNotNull;
import com.tangzc.mpe.annotation.InsertFillTime;
import com.tangzc.mpe.annotation.InsertUpdateFillTime;
import com.tangzc.mpe.autotable.annotation.*;
import com.tangzc.mpe.processer.annotation.AutoDefine;
import com.tangzc.mpe.processer.annotation.AutoMapper;
import com.tangzc.mpe.processer.annotation.AutoRepository;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 排行榜表
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper
@Table(comment = "排行榜表")
public class Ranking extends BaseEntity {
    @ColumnComment("主键")
    @ColumnId(mode = IdType.AUTO)
    private Long id;

    @ColumnComment("排行榜类型：1-日榜，2-周榜，3-月榜，4-总榜")
    @ColumnNotNull
    private Integer type;

    @ColumnComment("排行榜维度：1-浏览量，2-收藏数，3-评论数")
    @ColumnNotNull
    private Integer dimension;

    @ColumnComment("作品ID")
    @ColumnNotNull
    private String artworkId;

    @ColumnComment("排名")
    @ColumnNotNull
    private Integer rank;

    @ColumnComment("数值（根据维度不同代表不同的值）")
    @ColumnNotNull
    @ColumnDefault("0")
    private Integer value;

    @ColumnComment("统计日期")
    @ColumnNotNull
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime statisticsDate;


}